#ifndef OCK_MEMORY_BRIDGE_OCK_ACLADAPTER_OCK_ASYNC_TASK_BASE_H
#define OCK_MEMORY_BRIDGE_OCK_ACLADAPTER_OCK_ASYNC_TASK_BASE_H
#include <memory>
#include <thread>

#include "ock/hmm/mgr/OckHmmHMObject.h"
#include "ock/hmm/mgr/OckHmmErrorCode.h"
#include "ock/acladapter/executor/OckTaskStatisticsMgr.h"
#include "ock/acladapter/executor/OckAsyncTaskBase.h"

namespace ock {
namespace acladapter {

using OckDevRTStream = void *;




class OckAsyncTaskExecuteService
{
public:
    virtual ~OckAsyncTaskExecuteService() noexcept = default;
    virtual void AddTask(std::shared_ptr<OckAsyncTaskBase> task) = 0;
    virtual void CancelAll(void) = 0;
    virtual void Stop(void) = 0;
    virtual void AllStarted(void) const = 0;
    virtual uint32_t ThreadCount(void) const= 0;
    virtual uint32_t ActiveThreadCount(void) const= 0;
    virtual uint32_t TaskCount(void) const= 0;

    virtual hmm::OckHmmErrorCode StartErrorCode(void) const = 0;
    virtual std::shared_ptr<OckTaskStatisticsMgr> TaskStatisticsMgr(void) = 0;
    virtual const OckTaskThreadNumberMap &TaskThreadNumberMap(void) const = 0;

    static std::shared_ptr<OckAsyncTaskExecuteService> Create(
        hmm::OckHmmDeviceId deviceId, const cpu_set_t &cpuSet, const OckTaskThreadNumberMap &taskThreadMap);

};

std::ostream &operator<<(std::ostream &os, const OckAsyncTaskExecuteService &service);

}
}
#endif